#ifndef LFSR_H_
#define LFSR_H_

#include "CipherAlgorithm.h"
#include "alloc.h"
#include "int.h"

class Lfsr : public CipherAlgorithm{
private:
	int registre;
	int retroaction;
	int size;

public:
	Lfsr(void);
	Lfsr(char* keyPath);
    Lfsr(int size, char* init_registre, char* retroaction);

	virtual int generate_key(char* keyPath, int keySize);

	virtual int init(int size, char* init_registre, char* retroaction);
	virtual int generate_bits(const int key_size);
	virtual int encrypt(int data, int key);
	virtual void encrypt_into_buffer(char* buffer, int pos, int size, int data, int key);

	virtual void display(void) const;

	int getRegistre() const;
	int getRetroaction() const;
	int getSize() const;

	virtual ~Lfsr();

};

/*
#define KEY_SIZE 16
#define MINIMAL_KEY_SIZE 8


typedef struct{

	int registre;
	int retroaction;
	int size;

}lfsr_t;


lfsr_t* init_lfsr_t(char* init, char* retroaction);
void display_lfsr_t(lfsr_t *lfsr);
int lfsr_t_generate_key(lfsr_t *lfsr, int key_size);
int lfsr_t_encrypt(int data, int key);
*/

#endif
